class CreateLogEntries < ActiveRecord::Migration
  def self.up
    create_table :log_entries do |t|
      t.integer :logged_ip_address_id
      t.integer :logged_session_id
      t.integer :logged_action_id
      t.text :params
      t.datetime :accessed_at
      t.string :http_method
      t.decimal :completion_time_in_secs, :precision => 10, :scale => 5
      t.decimal :render_time_in_secs, :precision => 10, :scale => 5
      t.decimal :db_time_in_secs, :precision => 10, :scale => 5
      t.integer :http_status
    end
    
    add_index :log_entries, :logged_ip_address_id
    add_index :log_entries, :logged_session_id
    add_index :log_entries, :logged_action_id
    
  end

  def self.down
    drop_table :log_entries
  end
end
